<?php

namespace App\Models\Train\TrainOrderPassengers\Repositories\Interfaces;

use App\Models\Train\TrainOrderPassengers\TrainOrderPassenger;
use App\Models\Train\TrainOrders\TrainOrder;
use App\Models\Trip\TripOrderRefund\TripOrderRefund;
use App\Trip\Orders\BookOrders\Train\SelectedSeats\MatchedPassengers;
use App\Trip\Train\Order\Interfaces\OrderPassengerRefundInterface;

interface TrainOrderPassengersRepositoryInterface
{
    public function addPassengers(TrainOrder $order, $data);

    public function addOnePassenger(TrainOrder $order, $data): TrainOrderPassenger;

    public function findOneOrderPassenger(string $order_sn, string $passenger_id, int $sequence): TrainOrderPassenger;

    public function updatePassenger(TrainOrderPassenger $passenger, array $data);

    public function setPassengerMatchedSeat(MatchedPassengers $matchedPassenger);

    /**
     * 发起退款
     *
     * @param OrderPassengerRefundInterface $order_passenger_refund
     *
     * @return TripOrderRefund
     */
    public function refund(OrderPassengerRefundInterface $order_passenger_refund): TripOrderRefund;


    public function ticketReturnSuccess(TrainOrderPassenger $passenger, TripOrderRefund $refund_info);

    public function ticketReturnFailed(TrainOrderPassenger $passenger, TripOrderRefund $refund_info, string $failed_reason);

}